package a10_动态规划;

import java.util.Scanner;

/**
 * <p>
 * a22_爬楼梯进阶版复习4
 * </p>
 *
 * @author flyduck
 * @since 2025/4/16
 */
public class a22_爬楼梯进阶版复习4 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        int m = scanner.nextInt();

        int[] dp = new int[n+1];
        dp[0] = 1;
        for (int j = 0; j <= n; j++) {
            for (int i = 1; i <= m; i++) {
                if(j>=i){
                    dp[j] = dp[j] + dp[j-i];
                }

            }
        }
        System.out.println(dp[n]);
    }
}
